// Enemy.h
#pragma once
#include <QGraphicsPixmapItem>
#include <QObject>
#include <QPropertyAnimation>
#include <QSequentialAnimationGroup>
#include <QTimer>
#include <QPixmap>
#include <QVector>
#include<QGraphicsScene>

enum EnemyType { BOMBER, FIGHTER };

class Enemy : public QObject, public QGraphicsPixmapItem {
    Q_OBJECT
public:
    explicit Enemy(QObject* parent = nullptr);
    virtual void advance(int phase) override;
    virtual void explode();

protected:
    QVector<QPixmap> explosionFrames;
    int explosionIndex = 0;
    QTimer* explosionTimer = nullptr;
};

class BomberEnemy : public Enemy {
    Q_OBJECT
public:
    explicit BomberEnemy(QObject* parent = nullptr);
    void advance(int phase) override;
};

class FighterEnemy : public Enemy {
    Q_OBJECT
public:
    explicit FighterEnemy(QObject* parent = nullptr);
    void advance(int phase) override;
};


